﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GLYFrom.DDGL
{
    public partial class DD_insert : Form
    {
        public DD_insert()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string YHId = this.text_Id.Text.Trim();
            string DDH = this.text_DDH.Text.Trim();
            string Name = this.text_Name.Text.Trim();
            string Time = this.text_Time.Text.Trim();
            string JiaGe = this.text_JiaGe.Text.Trim();
            if (YHId.Length>0 && DDH.Length>0 && Name.Length>0 && Time.Length>0 && JiaGe.Length>0)
            {
                int sr = DBHelper.ZSG(string.Format("insert into T_DingDan values('{0}','{1}','{2}','{3}','{4}')", YHId, DDH, Name, Time, JiaGe));
                if (sr > 0)
                {
                    MessageBox.Show("添加成功！");
                }
                else
                {
                    MessageBox.Show("添加失败！");
                }
            }
            else
            {
                MessageBox.Show("添加失败，请填写完整！");
            }
        }

        private void DD_insert_Load(object sender, EventArgs e)
        {
        }
    }
}
